package com.genokon.controller;

import com.genokon.dto.OmiDiseaseDto;
import com.genokon.entry.GeneHpoEntry;
import com.genokon.entry.GeneOmiEntry;
import com.genokon.service.HpoAndOmiService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author by baichaoda
 * @date 2020/11/6 14:01
 */
@RestController
@RequestMapping("/gene")
public class HpoOmiController {
    @Resource
    private HpoAndOmiService hpoAndOmiService;

    @GetMapping("/hpo/{id}")
    GeneHpoEntry getHpo(@PathVariable("id") String id){
        return hpoAndOmiService.getByHpoId(id);
    }

    @GetMapping("/omi/{no}")
    GeneOmiEntry getOmi(@PathVariable("no") String no){
        return hpoAndOmiService.getByOmiNumber(no);
    }

    @GetMapping("/omi/symptom/{no}")
    OmiDiseaseDto getOmiSymptom(@PathVariable("no") Integer no){
        return hpoAndOmiService.getSymptomByMinId(no);
    }
}
